home *** CD-ROM | disk | FTP | other *** search
- remstart
- *-----------------------------------------------*
- | |
- | Pepsi Can Technology Demo |
- | Version 1.01 - 25th January 2001 |
- | |
- | Author: Rob Moran (theGecko) |
- | Web: http://www.gecko.f2s.com |
- | E-Mail: gecko@f2s.com |
- | AIM: Rob M0RAN |
- | ICQ#: 105558276 |
- | |
- | This demonstration shows a reflection |
- | technique known as 'Chrome Wrap' |
- | |
- | 100's - images/sprites |
- | 200's - objects |
- | |
- *-----------------------------------------------*
- remend
-
- `------------------------------------------------------SETUP------------------------------------------------------
-
- set display mode 800,600,16
- autocam off
- hide mouse
- sync on
- backdrop on
- color backdrop rgb(0,0,0)
- anglex# = -90.0
-
- `-----------images
-
- load image "map1.bmp",101
- load image "map2.bmp",102
- load image "text1.bmp", 106
-
- `convert image to sprite to make it see-through
- sprite 1,0,0,106
-
- `-----------models
-
- `load in the same object twice
- load object "can.x",201
- load object "can.x",202
-
- `position both objects in the same place
- position object 201,0,0,150
- position object 202,0,0,150
-
- `scale one object slightly smaller than the other so that their textures don't interfere
- scale object 202, 99, 99, 99
-
- `replace the texture of the 'larger' object with the reflection map and make it 'ghostly'
- texture object 201,101
- ghost object on 201
-
- `----------------------------------------------------MAIN LOOP----------------------------------------------------
-
- do
- `get any mouse movements
- anglex#=wrapvalue(anglex#-mousemovey())
- angley#=wrapvalue(angley#-mousemovex())
-
- `rotate both objects at the same time
- rotate object 201, anglex#, 0.0, angley#
- rotate object 202, anglex#, 0.0, angley#
-
- `this is the funky bit - move the texture offset of the reflection map in the opposite
- `direction as the mouse moves, thus keeping the texture facing the camera
- `the current angle must be tested to counteract the texture scrolling the wrong way
-
- if anglex# > 180 & anglex# < 360
- scroll object texture 201, (mousemovex()*0.00275), (mousemovey()*0.0055)
- else
- scroll object texture 201, (mousemovex()*0.00275), 0.0-(mousemovey()*0.0055)
- endif
- ` ^--------------------------^------- these numbers work for
- ` any model/texture
- `move camera in or out when mouse buttons pressed
- if mouseclick()=1 then move camera 5
- if mouseclick()=2 then move camera -5
-
- `change reflection map on keys '1' or '2'
- if keystate(2) then texture object 201,101
- if keystate(3) then texture object 201,102
-
- sync
- loop
-
- `------------------------------------------------------END--------------------------------------------------------
-